%% dXt=SIGMA(t) W sin(t)
%the revisible part are K,N,RNK, R(s), sigma(s), y0, tspan
clear all
casenum=2;
% index J for X
alphaK=15; alphas=[zeros(1,alphaK);eye(alphaK)];
fname='alphas'; save(fname,'alphas');
% time T
T = 1/2;
% time mesh 
num=50; tspan = linspace(0,T,num+1);
% construct orthogoal basis in L2[0,t]
%orthbasis(T); msvalue(num);
% sigma
%options = odeset('AbsTol',1e-12,'RelTol',1e-6);
options = [];
row=size(alphas,1); X0=zeros(row,1);
% solver of X
disp('solving X')
tic
[time,X] = ode45(@randomtest,tspan,X0,options,[num,alphaK],casenum);
toc

varitest(time,X.*X,casenum)